var t = getApp();

Page({
    data: {
        keyword: "",
        isLoadMore: !0,
        total_page: 0,
        page: 1,
        list: []
    },
    onLoad: function(t) {
        this.getData();
    },
    onSearch: function() {
        this.getData();
    },
    getData: function() {
        var a = this, o = t.getNetAddresss("plugin.diy-form-prove.frontend.controllers.prove.formDataLg");
        o += "&page=1", t._getNetWork({
            url: o,
            success: function(t) {
                var o = t.data;
                1 == o.result ? (a.data.total_page = o.data.list.last_page, a.data.page = 1, a.data.isLoadMore = !0, 
                a.setData({
                    list: o.data.list.data
                })) : wx.showToast({
                    icon: "none",
                    title: o.msg,
                    duration: 1e3
                });
            },
            fail: function(t) {
                console.log(t);
            }
        });
    },
    getMoreData: function() {
        var a = this;
        if (this.data.page >= this.data.total_page) this.setData({
            isLoadMore: !1
        }); else if (this.data.isLoadMore) {
            wx.showLoading({
                title: "加载中"
            }), this.data.page = this.data.page + 1, this.data.isLoadMore = !1;
            var o = t.getNetAddresss("plugin.diy-form-prove.frontend.controllers.prove.formDataLg");
            o += "&page=" + this.data.page, t._getNetWork({
                url: o,
                success: function(t) {
                    var o = t.data;
                    if (wx.hideLoading(), a.data.isLoadMore = !0, 1 == o.result) {
                        var e = o.data.list.data;
                        a.setData({
                            list: a.data.list.concat(e)
                        });
                    } else a.setData({
                        page: a.data.page - 1
                    }), wx.showToast({
                        title: o.msg,
                        duration: 1e3,
                        icon: "none"
                    });
                },
                fail: function(t) {
                    console.log(t.msg);
                }
            });
        }
    },
    changeKeyword: function(t) {
        this.setData({
            keyword: t.detail
        });
    },
    toUrl: function(t) {
        var a = t.currentTarget.dataset.id;
        wx.navigateTo({
            url: "/packageI/diyRormProve/diyRormProveDetail/diyRormProveDetail?id=" + a
        });
    },
    onReady: function() {},
    onShow: function() {},
    onHide: function() {},
    onUnload: function() {},
    onPullDownRefresh: function() {},
    onReachBottom: function() {
        this.getMoreData();
    },
    onShareAppMessage: function() {}
});